package com.sds.shop.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.BoardDAO;
import com.sds.shop.dao.ReplyDAO;

public class BoardDeleteAction extends Action {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		
		BoardDAO bdao = BoardDAO.getInstance();
		ReplyDAO rdao = ReplyDAO.getInstance();
		
		String boardNo = request.getParameter("boardNo");
		bdao.deleteBoard(boardNo);
		rdao.deleteReplys(boardNo);

		HttpUtil.redirect(response, "board.do");
	}

}
